import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkMemberEquityVO, SkMemberEquityForm, SkMemberEquityQuery } from '@/api/app/SkMemberEquity/types';

/**
 * 查询会员权益列表
 * @param query
 * @returns {*}
 */

export const listSkMemberEquity = (query?: SkMemberEquityQuery): AxiosPromise<SkMemberEquityVO[]> => {
  return request({
    url: '/app/SkMemberEquity/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询会员权益详细
 * @param id
 */
export const getSkMemberEquity = (id: string | number): AxiosPromise<SkMemberEquityVO> => {
  return request({
    url: '/app/SkMemberEquity/' + id,
    method: 'get'
  });
};

/**
 * 新增会员权益
 * @param data
 */
export const addSkMemberEquity = (data: SkMemberEquityForm) => {
  return request({
    url: '/app/SkMemberEquity',
    method: 'post',
    data: data
  });
};

/**
 * 修改会员权益
 * @param data
 */
export const updateSkMemberEquity = (data: SkMemberEquityForm) => {
  return request({
    url: '/app/SkMemberEquity',
    method: 'put',
    data: data
  });
};

/**
 * 删除会员权益
 * @param id
 */
export const delSkMemberEquity = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkMemberEquity/' + id,
    method: 'delete'
  });
};
